home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / ip / ka9q / osrc.arc / DAEMON.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-30  |  4.8 KB  |  154 lines

  1. #include "global.h"
  2. #include "cmdparse.h"
  3. #include "config.h"
  4. #include "daemon.h"
  5.  
  6. extern void killer(),timerproc(),network(),keyboard();
  7.  
  8. /* daemons to be run at startup time */
  9. struct daemon Daemons[] = {
  10.     "killer",    200,    killer,
  11.     "timer",    512,    timerproc,
  12.     "network",    1024,    network,
  13.     "keyboard",    250,    keyboard,
  14.     NULLCHAR,    0,    NULLVFP
  15. };
  16.  
  17. /* Command lookup and branch tables */
  18. int go(),doabort(),doax25(),doconnect(),dotelnet(),doexit(),doclose(),
  19.     dohostname(),doreset(),dotcp(),dotrace(),doescape(),dohelp(),
  20.     doroute(),doecho(),dolog(),doip(),doetherstat(),
  21.     memstat(),doarp(),dosession(),doftp(),dostart(),dostop(),doattach(),
  22.     dosmtp(),doudp(),doparam(),doeol(),dohapnstat(),
  23.     doegstat(),dodump(),dorecord(),doupload(),dokick(),domode(),doshell(),
  24.     dodir(),docd(),doatstat(),doping(),doforward(),doremote(),donetrom(),
  25.     donrstat(),ps(),dosock(),dohs(),dofinger(),doasystat(),dodomain(),
  26.     dodelete(),dorename();
  27.  
  28. struct cmds Cmds[] = {
  29.     /* The "go" command must be first */
  30.     "",        go,        0, 0, NULLCHAR,
  31.     "!",        doshell,    0, 0, NULLCHAR,
  32.     "abort",    doabort,    0, 0, NULLCHAR,
  33. #if    (defined(MAC) && defined(APPLETALK))
  34.     "applestat",    doatstat,    0,    0, NULLCHAR,
  35. #endif
  36. #if    (defined(AX25) || defined(ETHER) || defined(APPLETALK))
  37.     "arp",        doarp,        0, 0, NULLCHAR,
  38. #endif
  39. #ifdef    ASY
  40.     "asystat",    doasystat,    0, 0, NULLCHAR,
  41. #endif
  42. #ifdef    AX25
  43.     "ax25",        doax25,        0, 0, NULLCHAR,
  44. #endif    
  45.     "attach",    doattach,    0, 2,
  46.         "attach <hardware> <hw specific options>",
  47. /* This one is out of alpabetical order to allow abbreviation to "c" */
  48. #ifdef    AX25
  49.     "connect",    doconnect,    1024, 3,"connect <interface> <callsign>",
  50. #endif
  51. #ifndef UNIX    /* BSD or SYS5 */
  52.     "cd",        docd,        0, 0, NULLCHAR,
  53. #endif
  54.     "close",    doclose,    0, 0, NULLCHAR,
  55.     "disconnect",    doclose,    0, 0, NULLCHAR,
  56.     "dir",        dodir,        0, 0, NULLCHAR,
  57.     "delete",    dodelete,    0, 2, NULLCHAR, /* note sequence */
  58.     "domain",    dodomain,    0, 0, NULLCHAR,
  59. #ifdef    HS
  60.     "hs",        dohs,        0, 0, NULLCHAR,
  61. #endif
  62. #ifdef    EAGLE
  63.     "eaglestat",    doegstat,    0, 0, NULLCHAR,
  64. #endif
  65.     "echo",        doecho,        0, 0, NULLCHAR,
  66.     "eol",        doeol,        0, 0, NULLCHAR,
  67. #ifndef    MSDOS
  68.     "escape",    doescape,    0, 0, NULLCHAR,
  69. #endif
  70. #ifdef    PC_EC
  71.     "etherstat",    doetherstat,    0, 0, NULLCHAR,
  72. #endif
  73.     "exit",        doexit,        0, 0, NULLCHAR,
  74.     "finger",    dofinger,    1024, 0, NULLCHAR,
  75.     "forward",    doforward,    0, 0, NULLCHAR,
  76.     "ftp",        doftp,        2048, 2, "ftp <address>",
  77. #ifdef HAPN
  78.     "hapnstat",    dohapnstat,    0, 0, NULLCHAR,
  79. #endif
  80.     "help",        dohelp,        0, 0, NULLCHAR,
  81.     "hostname",    dohostname,    0, 0, NULLCHAR,
  82.     "kick",        dokick,        0, 0, NULLCHAR,
  83.     "log",        dolog,        0, 0, NULLCHAR,
  84.     "ip",        doip,        0, 0, NULLCHAR,
  85.     "memstat",    memstat,    0, 0, NULLCHAR,
  86. #ifdef    AX25
  87.     "mode",        domode,        0, 2, "mode <interface>",
  88. #endif
  89. #ifdef    NETROM
  90.     "netrom",    donetrom,    0, 0, NULLCHAR,
  91. #ifdef    NRS
  92.     "nrstat",    donrstat,    0, 0, NULLCHAR,
  93. #endif    /* NRS */
  94. #endif    /* NETROM */
  95.     "param",    doparam,    0, 2, "param <interface>",
  96.     "ping",        doping,        512, 2, "ping <host>",
  97.     "ps",        ps,        0, 0, NULLCHAR,
  98. #ifndef UNIX /* BSD or SYS5 */
  99.     "pwd",        docd,        0, 0, NULLCHAR,
  100. #endif
  101.     "record",    dorecord,    0, 0, NULLCHAR,
  102.     "remote",    doremote,    0, 3, "remote [-p port] [-k key] [-a kickaddr] <address> exit|reset|kick",
  103.     "rename",    dorename,    0, 2, NULLCHAR,
  104.     "reset",    doreset,    0, 0, NULLCHAR,
  105.     "route",    doroute,    0, 0, NULLCHAR,
  106.     "session",    dosession,    0, 0, NULLCHAR,
  107.     "shell",    doshell,    0, 0, NULLCHAR,
  108.     "smtp",        dosmtp,        0, 0, NULLCHAR,
  109.     "socket",    dosock,        0, 0, NULLCHAR,
  110. #ifdef    SERVERS
  111.     "start",    dostart,    0, 2, "start <servername>",    /**/
  112.     "stop",        dostop,        0, 2, "stop <servername>",
  113. #endif
  114.     "tcp",        dotcp,        0, 0, NULLCHAR,
  115.     "telnet",    dotelnet,    1024, 2, "telnet <address>",
  116. #ifdef    TRACE
  117.     "trace",    dotrace,    0, 0, NULLCHAR,
  118. #endif
  119.     "udp",        doudp,        0, 0, NULLCHAR,
  120.     "upload",    doupload,    0, 0, NULLCHAR,
  121.     "?",        dohelp,        0, 0, NULLCHAR,
  122.     NULLCHAR,    NULLFP,        0, 0,
  123.         "Unknown command; type \"?\" for list",
  124. };
  125.  
  126. #ifdef    SERVERS
  127. /* "start" and "stop" subcommands */
  128. int dis1(),echo1(),ftpstart(),smtp1(),tnstart(),rem1(),finstart();
  129. struct cmds Startcmds[] = {
  130.     "discard",    dis1,        256, 0, NULLCHAR,
  131.     "echo",        echo1,        256, 0, NULLCHAR,
  132.     "finger",    finstart,    256, 0, NULLCHAR,
  133.     "ftp",        ftpstart,    256, 0, NULLCHAR,
  134.     "smtp",        smtp1,        256, 0, NULLCHAR,
  135.     "telnet",    tnstart,    256, 0, NULLCHAR,
  136.     "remote",    rem1,        128, 0, NULLCHAR,
  137.     NULLCHAR,    NULLFP,        0, 0,
  138.         "start options: discard, echo, finger, ftp, smtp, telnet, remote",
  139. };
  140. int dis0(),echo0(),ftp0(),smtp0(),tn0(),rem0(),fin0();
  141. struct cmds Stopcmds[] = {
  142.     "discard",    dis0,        0, 0, NULLCHAR,
  143.     "echo",        echo0,        0, 0, NULLCHAR,
  144.     "finger",    fin0,        0, 0, NULLCHAR,
  145.     "ftp",        ftp0,        0, 0, NULLCHAR,
  146.     "smtp",        smtp0,        0, 0, NULLCHAR,
  147.     "telnet",    tn0,        0, 0, NULLCHAR,
  148.     "remote",    rem0,        0, 0, NULLCHAR,
  149.     NULLCHAR,    NULLFP,        0, 0,
  150.         "stop options: discard, echo, finger, ftp, smtp, telnet, remote",
  151. };
  152. #endif    /* SERVERS */
  153.  
  154.